import {UPDATE_USER} from '../constant'

export const updateUser = userObj => {
    return ({type:UPDATE_USER,data:userObj})
}

// 登录
export const login = data => {
    return dispatch => {
        setTimeout(() => {
            dispatch(updateUser(data))
        }, 0)
    }
}


// 退出登录
export const logOut = () => {
    return dispatch => (dispatch(updateUser, { name: '' }))
}